package com.student.management.root.bean;

import java.util.List;
import java.util.Objects;

public class Menu {
    private int menuid;
    private String menuname;
    private int upmenuid;
    private int state;
    private String  desc;
    private String  url;
    private List<Role> roleList;
    private List<Menu> secondMenuList;//保存二级目录

    public Menu(int menuid, String menuname, int upmenuid, int state, String desc, String url, List<Role> roleList, List<Menu> secondMenuList) {
        this.menuid = menuid;
        this.menuname = menuname;
        this.upmenuid = upmenuid;
        this.state = state;
        this.desc = desc;
        this.url = url;
        this.roleList = roleList;
        this.secondMenuList = secondMenuList;
    }

    public Menu(int menuid, String menuname, int upmenuid, int state, String desc, String url) {
        this.menuid = menuid;
        this.menuname = menuname;
        this.upmenuid = upmenuid;
        this.state = state;
        this.desc = desc;
        this.url = url;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (!(o instanceof Menu)) return false;
        Menu menu = (Menu) o;
        return getMenuid() == menu.getMenuid() &&
                getUpmenuid() == menu.getUpmenuid() &&
                getState() == menu.getState() &&
                Objects.equals(getMenuname(), menu.getMenuname()) &&
                Objects.equals(getDesc(), menu.getDesc()) &&
                Objects.equals(getUrl(), menu.getUrl()) &&
                Objects.equals(getRoleList(), menu.getRoleList()) &&
                Objects.equals(getSecondMenuList(), menu.getSecondMenuList());
    }

    @Override
    public int hashCode() {
        return Objects.hash(getMenuid(), getMenuname(), getUpmenuid(), getState(), getDesc(), getUrl(), getRoleList(), getSecondMenuList());
    }

    @Override
    public String toString() {
        return "Menu{" +
                "menuid=" + menuid +
                ", menuname='" + menuname + '\'' +
                ", upmenuid=" + upmenuid +
                ", state=" + state +
                ", desc='" + desc + '\'' +
                ", url='" + url + '\'' +
                ", roleList=" + roleList +
                ", secondMenuList=" + secondMenuList +
                '}';
    }

    public List<Role> getRoleList() {
        return roleList;
    }

    public void setRoleList(List<Role> roleList) {
        this.roleList = roleList;
    }

    public List<Menu> getSecondMenuList() {
        return secondMenuList;
    }

    public void setSecondMenuList(List<Menu> secondMenuList) {
        this.secondMenuList = secondMenuList;
    }

    public Menu() {
    }

    public int getMenuid() {
        return menuid;
    }

    public void setMenuid(int menuid) {
        this.menuid = menuid;
    }

    public String getMenuname() {
        return menuname;
    }

    public void setMenuname(String menuname) {
        this.menuname = menuname;
    }

    public int getUpmenuid() {
        return upmenuid;
    }

    public void setUpmenuid(int upmenuid) {
        this.upmenuid = upmenuid;
    }

    public int getState() {
        return state;
    }

    public void setState(int state) {
        this.state = state;
    }

    public String getDesc() {
        return desc;
    }

    public void setDesc(String desc) {
        this.desc = desc;
    }

    public String getUrl() {
        return url;
    }

    public void setUrl(String url) {
        this.url = url;
    }


}

